package com.gitee.centerconfigclient3366.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ConfigController
 * @Description TODO       RefreshScope 当远程配置文件修改  调用刷新配置文件请求  post  /actuator/refresh
 * @Author xiongchao
 * @Date 2020/12/21 16:54
 **/
@RestController
@RefreshScope
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String port;


    @GetMapping("/configinfo")
    public String getInfo(){
        return port  + "\n\n\n" +  configInfo;
    }
}
